package com.ruoyi.mall.common.util;
import java.util.Map;

/**
 * 获取map中值的工具类,自动进行类型转换
 * @author jieGe
 */
public class MapUtils {

    public static String getString(String key, Map<String, Object> map) {
        if (map == null || key == null)
            throw new IllegalArgumentException();
        if (!map.containsKey(key))
            return null;
        Object value = map.get(key);
        if (value == null)
            return null;
        return value.toString();
    }
}
